package finalfrontier;

import java.util.Random;
import java.util.Vector;

/**Classe qui contient les beams et leur utilisation
 * @author Nicolas Roy Boourdages
 */

public class Player {
    
    private static Vector<Beam> beams;
    private static int selectedIndex;
    
    
    public Player() {
        super();
        beams = new Vector<Beam>();
        beams.add(new BeamDestruction("Rayon Destruction", 100, new float[]{1f,0f,0f,0.5f}));
        beams.add(new BeamInformation("Rayon Information", 0, new float[]{1f,1f,0f,0.5f}));
        beams.add(new BeamMineraux("Rayon Mineraux", 200, new float[]{1f,0.5f,0.1f,0.5f}));
        beams.add(new BeamVegetation("Rayon Vegetation", 200, new float[]{0f,1f, 0.1f,0.5f}));
        beams.add(new BeamCarnivore("Rayon Carnivore", 1000, new float[]{1f,0.5f, 0.5f,0.5f}));
        beams.add(new BeamHerbivore("Rayon Herbivore", 500, new float[]{0f,0.3f, 1f,0.5f}));
        beams.add(new BeamEnergie("Rayon Energie", 500, new float[]{0.3f,0.3f, 1f,0.5f}));
        beams.add(new BeamAge("Rayon Vieillissement", 500, new float[]{0f,0.7f, 1f,0.5f}));
        beams.add(new BeamTarget("Rayon Cible", 100, new float[]{0f,0.5f, 5f,0.5f}));
        selectedIndex = 0;
        
        
    }

    public static void tirer(int i, int j) {
        beams.get(selectedIndex).singleShot(i,j);
    }

    public static void rotateSelectedIndex() {
        if(selectedIndex < beams.size() - 1){
            selectedIndex++;
        }
        else{
            selectedIndex = 0;
        }
    }
    
    public static String getSelectedBeamName(){
        return beams.get(selectedIndex).getName();
    }
    public static float[] getSelectedBeamColor(){
        return beams.get(selectedIndex).getColor();
    }
    
    public static int getBeamCost(){
        return beams.get(selectedIndex).getCost();
    }
}
